package com.lepu.app.fun.my.bean;

import java.io.Serializable;
import org.json.JSONException;
import org.json.JSONObject;

@SuppressWarnings("serial")
public class BeanMessageCount implements Serializable{

    public int motherCount;  
    public int phoneCount;   
    public int writerCount; 
    public int friendCount; 
    public int systemCount; 
    
    public static BeanMessageCount parseJsonData(String dataString) {
    	BeanMessageCount beanMsg = new BeanMessageCount();
        try {
            JSONObject jsonObject = new JSONObject(dataString);
            JSONObject obj1 = (JSONObject) jsonObject.get("Result");
            JSONObject objDetail = obj1.getJSONObject("DetailInfo");
            
            beanMsg.motherCount = objDetail.getInt("NewMessageCount_Topic");  
            beanMsg.phoneCount = objDetail.getInt("NewMessageCount_Album"); 
            beanMsg.writerCount = objDetail.getInt("NewMessageCount_Article");  
            beanMsg.friendCount = objDetail.getInt("NewMessageCount_Relation");  
            beanMsg.systemCount = objDetail.getInt("NewMessageCount_Inner");  
				
        } catch (JSONException e) {
            e.printStackTrace();
        }
        
        return beanMsg;
    }
    
}
